<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>layui</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="__LAYUIMINI__/lib/layui-v2.6.3/css/layui.css" media="all">
    <link rel="stylesheet" href="__LAYUIMINI__/lib/font-awesome-4.7.0/css/font-awesome.min.css" media="all">
    <link rel="stylesheet" href="__LAYUIMINI__/css/public.css" media="all">
</head>
<style type="text/css">
 
    .uploader-list {
        margin-left: -15px;
    }

    .uploader-list .info {
        position: relative;
        margin-top: -25px;
        background-color: black;
        color: white;
        filter: alpha(Opacity=80);
        -moz-opacity: 0.5;
        opacity: 0.5;
        width: 100px;
        height: 25px;
        text-align: center;
        display: none;
    }

    .uploader-list .handle{
        position: relative;
        background-color: black;
        color: white;
        filter: alpha(Opacity=80);
        -moz-opacity: 0.5;
        opacity: 0.5;
        width: 100px;
        text-align: right;
        height: 18px;
        margin-bottom: -18px;
        display: none;
    }

    .uploader-list .handle  i{
        margin-right: 5px;
    }

    .uploader-list .handle  i:hover {
        cursor: pointer;
    }

    .uploader-list .handle-video{
        position: relative;
        background-color: black;
        color: white;
        filter: alpha(Opacity=80);
        -moz-opacity: 0.5;
        opacity: 0.5;
        width: 100px;
        text-align: right;
        height: 18px;
        margin-bottom: -18px;
        display: none;
    }

    .uploader-list .handle-video  i{
        margin-right: 5px;
    }

    .uploader-list .handle-video  i:hover {
        cursor: pointer;
    }


    .uploader-list .file-iteme {
        margin: 12px 0 0 15px;
        padding: 1px;
        float: left;
    }

    .flex-container {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        width: 100%;
    }
    

</style>

<body>
    <div class="layuimini-container">
        <div class="layuimini-main">
            <!-- layui-form-pane 方框式表单 -->
            <form class="layui-form layui-form-pane" action="" lay-filter="example">
                <div class="layui-form-item">
                    <label class="layui-form-label">店铺名称</label>
                    <div class="layui-input-block">
                        <input type="text"  lay-verify="required" value="{$one['name']}" autocomplete="off" disabled placeholder="请输入名称"
                            class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">店铺编号</label>
                    <div class="layui-input-block">
                        <input type="text"  lay-verify="required" value="{$one['number']}" autocomplete="off" disabled placeholder="请输入名称"
                            class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">logo</label>
                    <div class="layui-input-block">
                        <div class="layui-upload">
                            <div class="layui-upload-list">
                                <img class="layui-upload-img" id="demo1" style="max-width: 300px;max-height: 300px;" src="{$one['logo']}">
                                <p id="demoText"></p>
                            </div>
                            <input type="hidden" id="file_id">
                            
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">店铺简介</label>
                    <div class="layui-input-block">
                        <textarea class="layui-textarea"  title="" readonly >{$one['introductory']}</textarea>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">地址</label>
                    <div class="layui-input-block">
                        <input type="text"  value="{$one['address']}" disabled autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">联系方式</label>
                    <div class="layui-input-block">
                        <input type="text"  value="{$one['tel']}" disabled autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">联系电话</label>
                    <div class="layui-input-block">
                        <input type="text"  value="{$one['phone']}" disabled autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">状态</label>
                    <div class="layui-input-block">
                        <input type="radio" name="status" value="1" title="禁用" >
                        <input type="radio" name="status" value="0" title="启用"  >
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">微信二维码</label>
                    <div class="layui-input-block">
                        <div class="layui-upload">
                            <div class="layui-upload-list">
                                <img class="layui-upload-img" id="demo1" style="max-width: 300px;max-height: 300px;" src="{$one['weichat']}">
                                <p id="demoText"></p>
                            </div>
                            <input type="hidden" id="file_id">
                            
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">创建时间</label>
                    <div class="layui-input-block">
                        <input type="text"  value="{$one['created_at']}" disabled autocomplete="off" class="layui-input">
                    </div>
                </div>

                <div class="layui-form-item" >
                    <label class="layui-form-label">内容</label>
                    <div class="layui-input-block">
                        <textarea class="span12 ckeditor" id="goods_content" disabled  title="">{$one['content']}</textarea>
                    </div>
                </div>
                
                <input type="hidden" name="id" id="" value="{$one['id']}">
           
                <div class="layui-form-item">
                    <div class="layui-input-block">
                        <button class="layui-btn" lay-submit="" lay-filter="demo1">立即提交</button>
                        <!-- <button type="reset" class="layui-btn layui-btn-primary">重置</button> -->
                    </div>
                </div>
            </form>
        </div>
    </div>

    <script src="__LAYUIMINI__/lib/layui-v2.6.3/layui.js" charset="utf-8"></script>
    <script src="__LAYUIMINI__/js/lay-config.js?v=1.0.4" charset="utf-8"></script>
    
<script src="__LAYUIMINI__/lib/jquery-3.4.1/jquery-3.4.1.min.js" charset="utf-8"></script>
<script type="text/javascript" charset="utf-8" src="__LAYUIMINI__/ueditor/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="__LAYUIMINI__/ueditor/ueditor.all.js"></script>
<script type="text/javascript" charset="utf-8" src="__LAYUIMINI__/ueditor/lang/zh-cn/zh-cn.js"></script>
    <!-- 注意：如果你直接复制所有代码到本地，上述js路径需要改成你本地的 -->
    <script>
        layui.use(['form', 'iconPickerFa',"upload",'element'], function () {
            var form = layui.form,
                iconPickerFa = layui.iconPickerFa,
                $ = layui.$,
                upload = layui.upload,
                layer = layui.layer,
                element = layui.element;


                var status = "{$one['status']}";
                $("input[name=status][value="+status+"]").prop("checked","true");
                layui.form.render();


             


            //监听指定开关
            form.on('switch(switchTest)', function (data) {

            });

            //监听提交
            form.on('submit(demo1)', function (data) {
               
                $.ajax({
                    type: "post",
                    url: "saveStore",
                    data: data.field,
                    dataType: "json",
                    success: function (res) {
                        if (res.code == 1) {
                            var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
                            // parent.layer.close(index); //再执行关闭 
                            // 关闭后调用
                            layer.msg(res.msg)
                            setTimeout(function () {
                                parent.layer.close(index);
                            }, 500)
                        } else {
                            layer.msg(res.msg)
                        }


                    }
                });
                return false;
            });

        });
    </script>
   <script type="text/javascript">

    var editor;
    $(function () {
        //具体参数配置在  editor_config.js  中
        var options = {
            zIndex: 999,
            initialFrameWidth: "95%", //初化宽度
            initialFrameHeight: 400, //初化高度
            focus: false, //初始化时，是否让编辑器获得焦点true或false
            maximumWords: 99999, removeFormatAttributes: 'class,style,lang,width,height,align,hspace,valign'
            , //允许的最大字符数 'fullscreen',
            pasteplain:false, //是否默认为纯文本粘贴。false为不使用纯文本粘贴，true为使用纯文本粘贴
            autoHeightEnabled: true
            /*   autotypeset: {
             mergeEmptyline: true,        //合并空行
             removeClass: true,           //去掉冗余的class
             removeEmptyline: false,      //去掉空行
             textAlign: "left",           //段落的排版方式，可以是 left,right,center,justify 去掉这个属性表示不执行排版
             imageBlockLine: 'center',    //图片的浮动方式，独占一行剧中,左右浮动，默认: center,left,right,none 去掉这个属性表示不执行排版
             pasteFilter: false,          //根据规则过滤没事粘贴进来的内容
             clearFontSize: false,        //去掉所有的内嵌字号，使用编辑器默认的字号
             clearFontFamily: false,      //去掉所有的内嵌字体，使用编辑器默认的字体
             removeEmptyNode: false,      //去掉空节点
             //可以去掉的标签
             removeTagNames: {"font": 1},
             indent: false,               // 行首缩进
             indentValue: '0em'           //行首缩进的大小
             }*/,
            toolbars: [
                ['fullscreen', 'source', '|', 'undo', 'redo',
                 '|', 'bold', 'italic', 'underline', 'fontborder',
                 'strikethrough', 'superscript', 'subscript',
                 'removeformat', 'formatmatch', 'autotypeset',
                 'blockquote', 'pasteplain', '|', 'forecolor',
                 'backcolor', 'insertorderedlist',
                 'insertunorderedlist', 'selectall', 'cleardoc', '|',
                 'rowspacingtop', 'rowspacingbottom', 'lineheight', '|',
                 'customstyle', 'paragraph', 'fontfamily', 'fontsize',
                 '|', 'directionalityltr', 'directionalityrtl',
                 'indent', '|', 'justifyleft', 'justifycenter',
                 'justifyright', 'justifyjustify', '|', 'touppercase',
                 'tolowercase', '|', 'link', 'unlink', 'anchor', '|',
                 'imagenone', 'imageleft', 'imageright', 'imagecenter',
                 '|', 'insertimage', 'emotion', 'insertvideo',
                 'attachment', 'map', 'gmap', 'insertframe',
                 'insertcode', 'webapp', 'pagebreak', 'template',
                 'background', '|', 'horizontal', 'date', 'time',
                 'spechars', 'wordimage', '|',
                 'inserttable', 'deletetable',
                 'insertparagraphbeforetable', 'insertrow', 'deleterow',
                 'insertcol', 'deletecol', 'mergecells', 'mergeright',
                 'mergedown', 'splittocells', 'splittorows',
                 'splittocols', '|', 'print', 'preview', 'searchreplace']
            ]
        };
        editor = new UE.ui.Editor(options);
        editor.render("goods_content");  //  指定 textarea 的  id 为 goods_content

    });
</script>

</body>

</html>